# 子系统类 - 文件读取
class FileReader:
    def read(self, file_name_src: str) -> str:
        print(f"读取文件: {file_name_src}")
        # 模拟文件读取
        with open(file_name_src, 'r', encoding='utf-8') as file:
            content = file.read()
        return content

# 子系统类 - 加密机
class CipherMachine:
    def encrypt(self, plain_text: str) -> str:
        print("正在进行加密...")
        # 简单的移位加密
        shift = 3
        result = []
        for char in plain_text:
            if char.isalpha():
                if char.isupper():
                    result.append(chr((ord(char) - 65 + shift) % 26 + 65))
                else:
                    result.append(chr((ord(char) - 97 + shift) % 26 + 97))
            else:
                result.append(char)
        return ''.join(result)

# 子系统类 - 文件写入
class FileWriter:
    def write(self, encrypt_text: str, file_name_des: str) -> None:
        print(f"写入加密文件: {file_name_des}")
        # 模拟文件写入
        with open(file_name_des, 'w', encoding='utf-8') as file:
            file.write(encrypt_text)

# 外观类
class EncryptFacade:
    def __init__(self):
        self.reader = FileReader()
        self.cipher = CipherMachine()
        self.writer = FileWriter()
    
    def file_encrypt(self, file_name_src: str, file_name_des: str) -> None:
        print("开始文件加密流程...")
        # 1. 读取文件
        plain_str = self.reader.read(file_name_src)
        # 2. 加密
        encrypt_str = self.cipher.encrypt(plain_str)
        # 3. 写入文件
        self.writer.write(encrypt_str, file_name_des)
        print("文件加密完成!")